package com.design.patterns.list.bridge;

/**
 * Abstraction 抽象类
 * 顶层抽象的产品
 * @author Wangzhiwen
 */
public abstract class Phone {

    // 聚合实现的接口
    private Brand brand;

    // 构造器注入
    public Phone(Brand brand) {
        this.brand = brand;
    }
    // set方式注入
    public void setBrand(Brand brand) {
        this.brand = brand;
    }

    // 子类访问权限的功能方法
    protected void open(){
        brand.open();
    }

    protected void close(){
        brand.close();
    }

    protected void call(){
        brand.call();
    }
}
